<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Win32 - Interfaces to some Win32 API Functions - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/Win32">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="Win32.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/Win32">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/Win32">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/Win32">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/Win32">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/Win32">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/Win32">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/Win32">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/Win32">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/Win32">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/Win32">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/Win32">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/Win32">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/Win32">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/Win32">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/Win32">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/Win32">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/Win32">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/Win32">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/Win32">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/Win32">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/Win32">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/Win32">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/Win32">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/Win32">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/Win32">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/Win32">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/Win32">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/Win32">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/Win32">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/Win32">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/Win32">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/Win32">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/Win32">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/Win32">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/Win32">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/Win32">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/Win32">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/Win32">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/Win32">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/Win32">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/Win32">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/Win32">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/Win32">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/Win32">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/Win32">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/Win32">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/Win32">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/Win32">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/Win32">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/Win32">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/Win32">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/Win32">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/Win32">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/Win32">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/Win32">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/Win32">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/Win32">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/Win32">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/Win32">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/Win32">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/Win32">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/Win32">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/Win32">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/Win32">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/Win32">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/Win32">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/Win32">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/Win32">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/Win32">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/Win32">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/Win32">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/Win32">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/Win32">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/Win32">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/Win32">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/Win32">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/Win32">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/Win32">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/Win32">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/Win32">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="Win32.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/Win32">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/Win32">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/Win32">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/Win32">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/Win32">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/Win32">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/Win32">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/Win32">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/Win32">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/Win32">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/Win32">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/Win32">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/Win32">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/Win32">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/Win32">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/Win32">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/Win32">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/Win32">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/Win32">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/Win32">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/Win32">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/Win32">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/Win32">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/Win32">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/Win32">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/Win32">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/Win32">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/Win32">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/Win32">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/Win32">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/Win32">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/Win32">5.35.1</a>
          <a class="dropdown-item active" href="Win32.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="Win32.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="Win32.html">Win32</a>
          <div id="more">
            (<a href="Win32.txt">source</a>,
            <a href="https://metacpan.org/pod/Win32">CPAN</a>)
          </div>
            <div id="moduleversion">version 0.57</div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="Win32.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Win32.html#DESCRIPTION">DESCRIPTION</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="Win32.html#Alphabetical-Listing-of-Win32-Functions">Alphabetical Listing of Win32 Functions</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="Win32.html#CAVEATS">CAVEATS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="Win32.html#Short-Path-Names">Short Path Names</a>
              </li>
          </ul>

              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="Win32.html#NAME">#</a>NAME</h1>

<p>Win32 - Interfaces to some Win32 API Functions</p>

<h1 id="DESCRIPTION"><a class="permalink" href="Win32.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>The Win32 module contains functions to access Win32 APIs.</p>

<h2 id="Alphabetical-Listing-of-Win32-Functions"><a class="permalink" href="Win32.html#Alphabetical-Listing-of-Win32-Functions">#</a><a id="Alphabetical"></a>Alphabetical Listing of Win32 Functions</h2>

<p>It is recommended to <code>use Win32;</code> before any of these functions; however, for backwards compatibility, those marked as [CORE] will automatically do this for you.</p>

<p>In the function descriptions below the term <i>Unicode string</i> is used to indicate that the string may contain characters outside the system codepage. The caveat <i>If supported by the core Perl version</i> generally means Perl 5.8.9 and later, though some Unicode pathname functionality may work on earlier versions.</p>

<dl>

<dt id="Win32::AbortSystemShutdown(MACHINE)"><a class="permalink" href="Win32.html#Win32::AbortSystemShutdown(MACHINE)">#</a><a id="Win32"></a><a id="Win32::AbortSystemShutdown-MACHINE"></a>Win32::AbortSystemShutdown(MACHINE)</dt>
<dd>

<p>Aborts a system shutdown (started by the InitiateSystemShutdown function) on the specified MACHINE.</p>

</dd>
<dt id="Win32::BuildNumber()"><a class="permalink" href="Win32.html#Win32::BuildNumber()">#</a><a id="Win321"></a><a id="Win32::BuildNumber"></a>Win32::BuildNumber()</dt>
<dd>

<p>[CORE] Returns the ActivePerl build number. This function is only available in the ActivePerl binary distribution.</p>

</dd>
<dt id="Win32::CopyFile(FROM,-TO,-OVERWRITE)"><a class="permalink" href="Win32.html#Win32::CopyFile(FROM,-TO,-OVERWRITE)">#</a><a id="Win322"></a><a id="Win32::CopyFile-FROM-TO-OVERWRITE"></a>Win32::CopyFile(FROM, TO, OVERWRITE)</dt>
<dd>

<p>[CORE] The Win32::CopyFile() function copies an existing file to a new file. All file information like creation time and file attributes will be copied to the new file. However it will <b>not</b> copy the security information. If the destination file already exists it will only be overwritten when the OVERWRITE parameter is true. But even this will not overwrite a read-only file; you have to unlink() it first yourself.</p>

</dd>
<dt id="Win32::CreateDirectory(DIRECTORY)"><a class="permalink" href="Win32.html#Win32::CreateDirectory(DIRECTORY)">#</a><a id="Win323"></a><a id="Win32::CreateDirectory-DIRECTORY"></a>Win32::CreateDirectory(DIRECTORY)</dt>
<dd>

<p>Creates the DIRECTORY and returns a true value on success. Check $^E on failure for extended error information.</p>

<p>DIRECTORY may contain Unicode characters outside the system codepage. Once the directory has been created you can use Win32::GetANSIPathName() to get a name that can be passed to system calls and external programs.</p>

</dd>
<dt id="Win32::CreateFile(FILE)"><a class="permalink" href="Win32.html#Win32::CreateFile(FILE)">#</a><a id="Win324"></a><a id="Win32::CreateFile-FILE"></a>Win32::CreateFile(FILE)</dt>
<dd>

<p>Creates the FILE and returns a true value on success. Check $^E on failure for extended error information.</p>

<p>FILE may contain Unicode characters outside the system codepage. Once the file has been created you can use Win32::GetANSIPathName() to get a name that can be passed to system calls and external programs.</p>

</dd>
<dt id="Win32::DomainName()"><a class="permalink" href="Win32.html#Win32::DomainName()">#</a><a id="Win325"></a><a id="Win32::DomainName"></a>Win32::DomainName()</dt>
<dd>

<p>[CORE] Returns the name of the Microsoft Network domain or workgroup that the owner of the current perl process is logged into. The &quot;Workstation&quot; service must be running to determine this information. This function does <b>not</b> work on Windows 9x.</p>

</dd>
<dt id="Win32::ExpandEnvironmentStrings(STRING)"><a class="permalink" href="Win32.html#Win32::ExpandEnvironmentStrings(STRING)">#</a><a id="Win326"></a><a id="Win32::ExpandEnvironmentStrings-STRING"></a>Win32::ExpandEnvironmentStrings(STRING)</dt>
<dd>

<p>Takes STRING and replaces all referenced environment variable names with their defined values. References to environment variables take the form <code>%VariableName%</code>. Case is ignored when looking up the VariableName in the environment. If the variable is not found then the original <code>%VariableName%</code> text is retained. Has the same effect as the following:</p>

<pre><code>$string =~ s/%([^%]*)%/$ENV{$1} || &quot;%$1%&quot;/eg</code></pre>

<p>However, this function may return a Unicode string if the environment variable being expanded hasn&#39;t been assigned to via %ENV. Access to %ENV is currently always using byte semantics.</p>

</dd>
<dt id="Win32::FormatMessage(ERRORCODE)"><a class="permalink" href="Win32.html#Win32::FormatMessage(ERRORCODE)">#</a><a id="Win327"></a><a id="Win32::FormatMessage-ERRORCODE"></a>Win32::FormatMessage(ERRORCODE)</dt>
<dd>

<p>[CORE] Converts the supplied Win32 error number (e.g. returned by Win32::GetLastError()) to a descriptive string. Analogous to the perror() standard-C library function. Note that <code>$^E</code> used in a string context has much the same effect.</p>

<pre><code class="plaintext">C:\&gt; perl -e &quot;$^E = 26; print $^E;&quot;
The specified disk or diskette cannot be accessed</code></pre>

</dd>
<dt id="Win32::FsType()"><a class="permalink" href="Win32.html#Win32::FsType()">#</a><a id="Win328"></a><a id="Win32::FsType"></a>Win32::FsType()</dt>
<dd>

<p>[CORE] Returns the name of the filesystem of the currently active drive (like &#39;FAT&#39; or &#39;NTFS&#39;). In list context it returns three values: (FSTYPE, FLAGS, MAXCOMPLEN). FSTYPE is the filesystem type as before. FLAGS is a combination of values of the following table:</p>

<pre><code class="plaintext">0x00000001  supports case-sensitive filenames
0x00000002  preserves the case of filenames
0x00000004  supports Unicode in filenames
0x00000008  preserves and enforces ACLs
0x00000010  supports file-based compression
0x00000020  supports disk quotas
0x00000040  supports sparse files
0x00000080  supports reparse points
0x00000100  supports remote storage
0x00008000  is a compressed volume (e.g. DoubleSpace)
0x00010000  supports object identifiers
0x00020000  supports the Encrypted File System (EFS)</code></pre>

<p>MAXCOMPLEN is the maximum length of a filename component (the part between two backslashes) on this file system.</p>

</dd>
<dt id="Win32::FreeLibrary(HANDLE)"><a class="permalink" href="Win32.html#Win32::FreeLibrary(HANDLE)">#</a><a id="Win329"></a><a id="Win32::FreeLibrary-HANDLE"></a>Win32::FreeLibrary(HANDLE)</dt>
<dd>

<p>Unloads a previously loaded dynamic-link library. The HANDLE is no longer valid after this call. See <a>LoadLibrary</a> for information on dynamically loading a library.</p>

</dd>
<dt id="Win32::GetACP()"><a class="permalink" href="Win32.html#Win32::GetACP()">#</a><a id="Win3210"></a><a id="Win32::GetACP"></a>Win32::GetACP()</dt>
<dd>

<p>Returns the current Windows ANSI code page identifier for the operating system. See also GetOEMCP(), GetConsoleCP() and GetConsoleOutputCP().</p>

</dd>
<dt id="Win32::GetANSIPathName(FILENAME)"><a class="permalink" href="Win32.html#Win32::GetANSIPathName(FILENAME)">#</a><a id="Win3211"></a><a id="Win32::GetANSIPathName-FILENAME"></a>Win32::GetANSIPathName(FILENAME)</dt>
<dd>

<p>Returns an ANSI version of FILENAME. This may be the short name if the long name cannot be represented in the system codepage.</p>

<p>While not currently implemented, it is possible that in the future this function will convert only parts of the path to FILENAME to a short form.</p>

<p>If FILENAME doesn&#39;t exist on the filesystem, or if the filesystem doesn&#39;t support short ANSI filenames, then this function will translate the Unicode name into the system codepage using replacement characters.</p>

</dd>
<dt id="Win32::GetArchName()"><a class="permalink" href="Win32.html#Win32::GetArchName()">#</a><a id="Win3212"></a><a id="Win32::GetArchName"></a>Win32::GetArchName()</dt>
<dd>

<p>Use of this function is deprecated. It is equivalent with $ENV{PROCESSOR_ARCHITECTURE}. This might not work on Win9X.</p>

</dd>
<dt id="Win32::GetChipName()"><a class="permalink" href="Win32.html#Win32::GetChipName()">#</a><a id="Win3213"></a><a id="Win32::GetChipName"></a>Win32::GetChipName()</dt>
<dd>

<p>Returns the processor type: 386, 486 or 586 for x86 processors, 8664 for the x64 processor and 2200 for the Itanium. Since it returns the native processor type it will return a 64-bit processor type even when called from a 32-bit Perl running on 64-bit Windows.</p>

</dd>
<dt id="Win32::GetConsoleCP()"><a class="permalink" href="Win32.html#Win32::GetConsoleCP()">#</a><a id="Win3214"></a><a id="Win32::GetConsoleCP"></a>Win32::GetConsoleCP()</dt>
<dd>

<p>Returns the input code page used by the console associated with the calling process. To set the console&#39;s input code page, see SetConsoleCP(). See also GetConsoleOutputCP(), GetACP() and GetOEMCP().</p>

</dd>
<dt id="Win32::GetConsoleOutputCP()"><a class="permalink" href="Win32.html#Win32::GetConsoleOutputCP()">#</a><a id="Win3215"></a><a id="Win32::GetConsoleOutputCP"></a>Win32::GetConsoleOutputCP()</dt>
<dd>

<p>Returns the output code page used by the console associated with the calling process. To set the console&#39;s output code page, see SetConsoleOutputCP(). See also GetConsoleCP(), GetACP(), and GetOEMCP().</p>

</dd>
<dt id="Win32::GetCwd()"><a class="permalink" href="Win32.html#Win32::GetCwd()">#</a><a id="Win3216"></a><a id="Win32::GetCwd"></a>Win32::GetCwd()</dt>
<dd>

<p>[CORE] Returns the current active drive and directory. This function does not return a UNC path, since the functionality required for such a feature is not available under Windows 95.</p>

<p>If supported by the core Perl version, this function will return an ANSI path name for the current directory if the long pathname cannot be represented in the system codepage.</p>

</dd>
<dt id="Win32::GetCurrentProcessId()"><a class="permalink" href="Win32.html#Win32::GetCurrentProcessId()">#</a><a id="Win3217"></a><a id="Win32::GetCurrentProcessId"></a>Win32::GetCurrentProcessId()</dt>
<dd>

<p>Returns the process identifier of the current process. Until the process terminates, the process identifier uniquely identifies the process throughout the system.</p>

<p>The current process identifier is normally also available via the predefined $$ variable. Under fork() emulation however $$ may contain a pseudo-process identifier that is only meaningful to the Perl kill(), wait() and waitpid() functions. The Win32::GetCurrentProcessId() function will always return the regular Windows process id, even when called from inside a pseudo-process.</p>

</dd>
<dt id="Win32::GetCurrentThreadId()"><a class="permalink" href="Win32.html#Win32::GetCurrentThreadId()">#</a><a id="Win3218"></a><a id="Win32::GetCurrentThreadId"></a>Win32::GetCurrentThreadId()</dt>
<dd>

<p>Returns the thread identifier of the calling thread. Until the thread terminates, the thread identifier uniquely identifies the thread throughout the system.</p>

</dd>
<dt id="Win32::GetFileVersion(FILENAME)"><a class="permalink" href="Win32.html#Win32::GetFileVersion(FILENAME)">#</a><a id="Win3219"></a><a id="Win32::GetFileVersion-FILENAME"></a>Win32::GetFileVersion(FILENAME)</dt>
<dd>

<p>Returns the file version number from the VERSIONINFO resource of the executable file or DLL. This is a tuple of four 16 bit numbers. In list context these four numbers will be returned. In scalar context they are concatenated into a string, separated by dots.</p>

</dd>
<dt id="Win32::GetFolderPath(FOLDER-[,-CREATE])"><a class="permalink" href="Win32.html#Win32::GetFolderPath(FOLDER-%5B,-CREATE%5D)">#</a><a id="Win3220"></a><a id="Win32::GetFolderPath-FOLDER-CREATE"></a>Win32::GetFolderPath(FOLDER [, CREATE])</dt>
<dd>

<p>Returns the full pathname of one of the Windows special folders. The folder will be created if it doesn&#39;t exist and the optional CREATE argument is true. The following FOLDER constants are defined by the Win32 module, but only exported on demand:</p>

<pre><code class="plaintext">CSIDL_ADMINTOOLS
CSIDL_APPDATA
CSIDL_CDBURN_AREA
CSIDL_COMMON_ADMINTOOLS
CSIDL_COMMON_APPDATA
CSIDL_COMMON_DESKTOPDIRECTORY
CSIDL_COMMON_DOCUMENTS
CSIDL_COMMON_FAVORITES
CSIDL_COMMON_MUSIC
CSIDL_COMMON_PICTURES
CSIDL_COMMON_PROGRAMS
CSIDL_COMMON_STARTMENU
CSIDL_COMMON_STARTUP
CSIDL_COMMON_TEMPLATES
CSIDL_COMMON_VIDEO
CSIDL_COOKIES
CSIDL_DESKTOP
CSIDL_DESKTOPDIRECTORY
CSIDL_FAVORITES
CSIDL_FONTS
CSIDL_HISTORY
CSIDL_INTERNET_CACHE
CSIDL_LOCAL_APPDATA
CSIDL_MYMUSIC
CSIDL_MYPICTURES
CSIDL_MYVIDEO
CSIDL_NETHOOD
CSIDL_PERSONAL
CSIDL_PRINTHOOD
CSIDL_PROFILE
CSIDL_PROGRAMS
CSIDL_PROGRAM_FILES
CSIDL_PROGRAM_FILES_COMMON
CSIDL_RECENT
CSIDL_RESOURCES
CSIDL_RESOURCES_LOCALIZED
CSIDL_SENDTO
CSIDL_STARTMENU
CSIDL_STARTUP
CSIDL_SYSTEM
CSIDL_TEMPLATES
CSIDL_WINDOWS</code></pre>

<p>Note that not all folders are defined on all versions of Windows.</p>

<p>Please refer to the MSDN documentation of the CSIDL constants, currently available at:</p>

<p>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp</p>

<p>This function will return an ANSI folder path if the long name cannot be represented in the system codepage. Use Win32::GetLongPathName() on the result of Win32::GetFolderPath() if you want the Unicode version of the folder name.</p>

</dd>
<dt id="Win32::GetFullPathName(FILENAME)"><a class="permalink" href="Win32.html#Win32::GetFullPathName(FILENAME)">#</a><a id="Win3221"></a><a id="Win32::GetFullPathName-FILENAME"></a>Win32::GetFullPathName(FILENAME)</dt>
<dd>

<p>[CORE] GetFullPathName combines the FILENAME with the current drive and directory name and returns a fully qualified (aka, absolute) path name. In list context it returns two elements: (PATH, FILE) where PATH is the complete pathname component (including trailing backslash) and FILE is just the filename part. Note that no attempt is made to convert 8.3 components in the supplied FILENAME to longnames or vice-versa. Compare with Win32::GetShortPathName() and Win32::GetLongPathName().</p>

<p>If supported by the core Perl version, this function will return an ANSI path name if the full pathname cannot be represented in the system codepage.</p>

</dd>
<dt id="Win32::GetLastError()"><a class="permalink" href="Win32.html#Win32::GetLastError()">#</a><a id="Win3222"></a><a id="Win32::GetLastError"></a>Win32::GetLastError()</dt>
<dd>

<p>[CORE] Returns the last error value generated by a call to a Win32 API function. Note that <code>$^E</code> used in a numeric context amounts to the same value.</p>

</dd>
<dt id="Win32::GetLongPathName(PATHNAME)"><a class="permalink" href="Win32.html#Win32::GetLongPathName(PATHNAME)">#</a><a id="Win3223"></a><a id="Win32::GetLongPathName-PATHNAME"></a>Win32::GetLongPathName(PATHNAME)</dt>
<dd>

<p>[CORE] Returns a representation of PATHNAME composed of longname components (if any). The result may not necessarily be longer than PATHNAME. No attempt is made to convert PATHNAME to the absolute path. Compare with Win32::GetShortPathName() and Win32::GetFullPathName().</p>

<p>This function may return the pathname in Unicode if it cannot be represented in the system codepage. Use Win32::GetANSIPathName() before passing the path to a system call or another program.</p>

</dd>
<dt id="Win32::GetNextAvailDrive()"><a class="permalink" href="Win32.html#Win32::GetNextAvailDrive()">#</a><a id="Win3224"></a><a id="Win32::GetNextAvailDrive"></a>Win32::GetNextAvailDrive()</dt>
<dd>

<p>[CORE] Returns a string in the form of &quot;&lt;d&gt;:&quot; where &lt;d&gt; is the first available drive letter.</p>

</dd>
<dt id="Win32::GetOEMCP()"><a class="permalink" href="Win32.html#Win32::GetOEMCP()">#</a><a id="Win3225"></a><a id="Win32::GetOEMCP"></a>Win32::GetOEMCP()</dt>
<dd>

<p>Returns the current original equipment manufacturer (OEM) code page identifier for the operating system. See also GetACP(), GetConsoleCP() and GetConsoleOutputCP().</p>

</dd>
<dt id="Win32::GetOSDisplayName()"><a class="permalink" href="Win32.html#Win32::GetOSDisplayName()">#</a><a id="Win3226"></a><a id="Win32::GetOSDisplayName"></a>Win32::GetOSDisplayName()</dt>
<dd>

<p>Returns the &quot;marketing&quot; name of the Windows operating system version being used. It returns names like these (random samples):</p>

<pre><code class="plaintext">Windows 2000 Datacenter Server
Windows XP Professional
Windows XP Tablet PC Edition
Windows Home Server
Windows Server 2003 Enterprise Edition for Itanium-based Systems
Windows Vista Ultimate (32-bit)
Windows Small Business Server 2008 R2 (64-bit)</code></pre>

<p>The display name describes the native Windows version, so even on a 32-bit Perl this function may return a &quot;Windows ... (64-bit)&quot; name when running on a 64-bit Windows.</p>

<p>This function should only be used to display the actual OS name to the user; it should not be used to determine the class of operating systems this system belongs to. The Win32::GetOSName(), Win32::GetOSVersion, Win32::GetProductInfo() and Win32::GetSystemMetrics() functions provide the base information to check for certain capabilities, or for families of OS releases.</p>

</dd>
<dt id="Win32::GetOSName()"><a class="permalink" href="Win32.html#Win32::GetOSName()">#</a><a id="Win3227"></a><a id="Win32::GetOSName"></a>Win32::GetOSName()</dt>
<dd>

<p>In scalar context returns the name of the Win32 operating system being used. In list context returns a two element list of the OS name and whatever edition information is known about the particular build (for Win9X boxes) and whatever service packs have been installed. The latter is roughly equivalent to the first item returned by GetOSVersion() in list context.</p>

<p>The description will also include tags for other special editions, like &quot;R2&quot;, &quot;Media Center&quot;, &quot;Tablet PC&quot;, or &quot;Starter Edition&quot;.</p>

<p>In the Windows 10 / Server Semi-Annual Channel era, the description may contain the relevant ReleaseId value, but this is only inferred from the build number, not determined absolutely.</p>

<p>Currently the possible values for the OS name are</p>

<pre><code class="plaintext">WinWin32s
Win95
Win98
WinMe
WinNT3.51
WinNT4
Win2000
WinXP/.Net
Win2003
WinHomeSvr
WinVista
Win2008
Win7
Win8
Win8.1
Win10
Win2016
Win2019
WinSAC</code></pre>

<p>This routine is just a simple interface into GetOSVersion(). More specific or demanding situations should use that instead. Another option would be to use POSIX::uname(), however the latter appears to report only the OS family name and not the specific OS. In scalar context it returns just the ID.</p>

<p>The name &quot;WinXP/.Net&quot; is used for historical reasons only, to maintain backwards compatibility of the Win32 module. Windows .NET Server has been renamed as Windows 2003 Server before final release and uses a different major/minor version number than Windows XP.</p>

<p>Similarly the name &quot;WinWin32s&quot; should have been &quot;Win32s&quot; but has been kept as-is for backwards compatibility reasons too.</p>

</dd>
<dt id="Win32::GetOSVersion()"><a class="permalink" href="Win32.html#Win32::GetOSVersion()">#</a><a id="Win3228"></a><a id="Win32::GetOSVersion"></a>Win32::GetOSVersion()</dt>
<dd>

<p>[CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), where the elements are, respectively: An arbitrary descriptive string, the major version number of the operating system, the minor version number, the build number, and a digit indicating the actual operating system. For the ID, the values are 0 for Win32s, 1 for Windows 9X/Me and 2 for Windows NT/2000/XP/2003/Vista/2008/7. In scalar context it returns just the ID.</p>

<p>Currently known values for ID MAJOR MINOR and BUILD are as follows:</p>

<pre><code class="plaintext">OS                      ID    MAJOR   MINOR   BUILD
Win32s                   0      -       -       -
Windows 95               1      4       0       -
Windows 98               1      4      10       -
Windows Me               1      4      90       -

Windows NT 3.51          2      3      51       -
Windows NT 4             2      4       0       -

Windows 2000             2      5       0       -
Windows XP               2      5       1       -
Windows Server 2003      2      5       2       -
Windows Server 2003 R2   2      5       2       -
Windows Home Server      2      5       2       -

Windows Vista            2      6       0       -
Windows Server 2008      2      6       0       -
Windows 7                2      6       1       -
Windows Server 2008 R2   2      6       1       -
Windows 8                2      6       2       -
Windows Server 2012      2      6       2       -
Windows 8.1              2      6       2       -
Windows Server 2012 R2   2      6       2       -

Windows 10               2     10       0       -
Windows Server 2016      2     10       0   14393
Windows Server 2019      2     10       0   17677</code></pre>

<p>On Windows NT 4 SP6 and later this function returns the following additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE.</p>

<p>The version numbers for Windows 2003 and Windows Home Server are identical; the SUITEMASK field must be used to differentiate between them.</p>

<p>The version numbers for Windows Vista and Windows Server 2008 are identical; the PRODUCTTYPE field must be used to differentiate between them.</p>

<p>The version numbers for Windows 7 and Windows Server 2008 R2 are identical; the PRODUCTTYPE field must be used to differentiate between them.</p>

<p>The version numbers for Windows 8 and Windows Server 2012 are identical; the PRODUCTTYPE field must be used to differentiate between them.</p>

<p>For modern Windows releases, the major and minor version numbers are identical. The PRODUCTTYPE field must be used to differentiate between Windows 10 and Server releases. The BUILD field is used to differentiate Windows Server versions: currently 2016, 2019, and Semi-Annual Channel releases.</p>

<p>SPMAJOR and SPMINOR are the version numbers of the latest installed service pack. (In the Windows 10 era, these are unused.)</p>

<p>SUITEMASK is a bitfield identifying the product suites available on the system. Known bits are:</p>

<pre><code class="plaintext">VER_SUITE_SMALLBUSINESS             0x00000001
VER_SUITE_ENTERPRISE                0x00000002
VER_SUITE_BACKOFFICE                0x00000004
VER_SUITE_COMMUNICATIONS            0x00000008
VER_SUITE_TERMINAL                  0x00000010
VER_SUITE_SMALLBUSINESS_RESTRICTED  0x00000020
VER_SUITE_EMBEDDEDNT                0x00000040
VER_SUITE_DATACENTER                0x00000080
VER_SUITE_SINGLEUSERTS              0x00000100
VER_SUITE_PERSONAL                  0x00000200
VER_SUITE_BLADE                     0x00000400
VER_SUITE_EMBEDDED_RESTRICTED       0x00000800
VER_SUITE_SECURITY_APPLIANCE        0x00001000
VER_SUITE_STORAGE_SERVER            0x00002000
VER_SUITE_COMPUTE_SERVER            0x00004000
VER_SUITE_WH_SERVER                 0x00008000
VER_SUITE_MULTIUSERTS               0x00020000</code></pre>

<p>The VER_SUITE_xxx names are listed here to cross reference the Microsoft documentation. The Win32 module does not provide symbolic names for these constants.</p>

<p>PRODUCTTYPE provides additional information about the system. It should be one of the following integer values:</p>

<pre><code class="plaintext">1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro, Vista, etc)
2 - Domaincontroller
3 - Server (2000 Server, Server 2003, Server 2008, etc)</code></pre>

<p>Note that a server that is also a domain controller is reported as PRODUCTTYPE 2 (Domaincontroller) and not PRODUCTTYPE 3 (Server).</p>

</dd>
<dt id="Win32::GetShortPathName(PATHNAME)"><a class="permalink" href="Win32.html#Win32::GetShortPathName(PATHNAME)">#</a><a id="Win3229"></a><a id="Win32::GetShortPathName-PATHNAME"></a>Win32::GetShortPathName(PATHNAME)</dt>
<dd>

<p>[CORE] Returns a representation of PATHNAME that is composed of short (8.3) path components where available. For path components where the file system has not generated the short form the returned path will use the long form, so this function might still for instance return a path containing spaces. Returns <code>undef</code> when the PATHNAME does not exist. Compare with Win32::GetFullPathName() and Win32::GetLongPathName().</p>

</dd>
<dt id="Win32::GetSystemMetrics(INDEX)"><a class="permalink" href="Win32.html#Win32::GetSystemMetrics(INDEX)">#</a><a id="Win3230"></a><a id="Win32::GetSystemMetrics-INDEX"></a>Win32::GetSystemMetrics(INDEX)</dt>
<dd>

<p>Retrieves the specified system metric or system configuration setting. Please refer to the Microsoft documentation of the GetSystemMetrics() function for a reference of available INDEX values. All system metrics return integer values.</p>

</dd>
<dt id="Win32::GetProcAddress(INSTANCE,-PROCNAME)"><a class="permalink" href="Win32.html#Win32::GetProcAddress(INSTANCE,-PROCNAME)">#</a><a id="Win3231"></a><a id="Win32::GetProcAddress-INSTANCE-PROCNAME"></a>Win32::GetProcAddress(INSTANCE, PROCNAME)</dt>
<dd>

<p>Returns the address of a function inside a loaded library. The information about what you can do with this address has been lost in the mist of time. Use the Win32::API module instead of this deprecated function.</p>

</dd>
<dt id="Win32::GetProcessPrivileges([PID])"><a class="permalink" href="Win32.html#Win32::GetProcessPrivileges(%5BPID%5D)">#</a><a id="Win3232"></a><a id="Win32::GetProcessPrivileges-PID"></a>Win32::GetProcessPrivileges([PID])</dt>
<dd>

<p>Returns a reference to a hash holding the information about the privileges held by the specified process. The keys are privilege names, and the values are booleans indicating whether a given privilege is currently enabled or not.</p>

<p>If the optional PID parameter is omitted, the function queries the current process.</p>

<p>Example return value:</p>

<pre><code>{
    SeTimeZonePrivilege =&gt; 0,
    SeShutdownPrivilege =&gt; 0,
    SeUndockPrivilege =&gt; 0,
    SeIncreaseWorkingSetPrivilege =&gt; 0,
    SeChangeNotifyPrivilege =&gt; 1
}</code></pre>

</dd>
<dt id="Win32::GetProductInfo(OSMAJOR,-OSMINOR,-SPMAJOR,-SPMINOR)"><a class="permalink" href="Win32.html#Win32::GetProductInfo(OSMAJOR,-OSMINOR,-SPMAJOR,-SPMINOR)">#</a><a id="Win3233"></a><a id="Win32::GetProductInfo-OSMAJOR-OSMINOR-SPMAJOR-SPMINOR"></a>Win32::GetProductInfo(OSMAJOR, OSMINOR, SPMAJOR, SPMINOR)</dt>
<dd>

<p>Retrieves the product type for the operating system on the local computer, and maps the type to the product types supported by the specified operating system. Please refer to the Microsoft documentation of the GetProductInfo() function for more information about the parameters and return value. This function requires Windows Vista or later.</p>

<p>See also the Win32::GetOSName() and Win32::GetOSDisplayName() functions which provide a higher level abstraction of the data returned by this function.</p>

</dd>
<dt id="Win32::GetTickCount()"><a class="permalink" href="Win32.html#Win32::GetTickCount()">#</a><a id="Win3234"></a><a id="Win32::GetTickCount"></a>Win32::GetTickCount()</dt>
<dd>

<p>[CORE] Returns the number of milliseconds elapsed since the last system boot. Resolution is limited to system timer ticks (about 10ms on WinNT and 55ms on Win9X).</p>

</dd>
<dt id="Win32::GuidGen()"><a class="permalink" href="Win32.html#Win32::GuidGen()">#</a><a id="Win3235"></a><a id="Win32::GuidGen"></a>Win32::GuidGen()</dt>
<dd>

<p>Creates a globally unique 128 bit integer that can be used as a persistent identifier in a distributed setting. To a very high degree of certainty this function returns a unique value. No other invocation, on the same or any other system (networked or not), should return the same value.</p>

<p>The return value is formatted according to OLE conventions, as groups of hex digits with surrounding braces. For example:</p>

<pre><code class="plaintext">{09531CF1-D0C7-4860-840C-1C8C8735E2AD}</code></pre>

</dd>
<dt id="Win32::InitiateSystemShutdown"><a class="permalink" href="Win32.html#Win32::InitiateSystemShutdown">#</a><a id="Win3236"></a>Win32::InitiateSystemShutdown</dt>
<dd>

<p>(MACHINE, MESSAGE, TIMEOUT, FORCECLOSE, REBOOT)</p>

<p>Shutsdown the specified MACHINE, notifying users with the supplied MESSAGE, within the specified TIMEOUT interval. Forces closing of all documents without prompting the user if FORCECLOSE is true, and reboots the machine if REBOOT is true. This function works only on WinNT.</p>

</dd>
<dt id="Win32::IsAdminUser()"><a class="permalink" href="Win32.html#Win32::IsAdminUser()">#</a><a id="Win3237"></a><a id="Win32::IsAdminUser"></a>Win32::IsAdminUser()</dt>
<dd>

<p>Returns non zero if the account in whose security context the current process/thread is running belongs to the local group of Administrators in the built-in system domain; returns 0 if not. On Windows Vista it will only return non-zero if the process is actually running with elevated privileges. Returns <code>undef</code> and prints a warning if an error occurred. This function always returns 1 on Win9X.</p>

</dd>
<dt id="Win32::IsDeveloperModeEnabled()"><a class="permalink" href="Win32.html#Win32::IsDeveloperModeEnabled()">#</a><a id="Win3238"></a><a id="Win32::IsDeveloperModeEnabled"></a>Win32::IsDeveloperModeEnabled()</dt>
<dd>

<p>Returns true if the developer mode is currently enabled. It always returns false on Windows versions older than Windows 10.</p>

</dd>
<dt id="Win32::IsSymlinkCreationAllowed()"><a class="permalink" href="Win32.html#Win32::IsSymlinkCreationAllowed()">#</a><a id="Win3239"></a><a id="Win32::IsSymlinkCreationAllowed"></a>Win32::IsSymlinkCreationAllowed()</dt>
<dd>

<p>Returns true if the current process is allowed to create symbolic links. This function is a convenience wrapper around Win32::GetProcessPrivileges() and Win32::IsDeveloperModeEnabled().</p>

</dd>
<dt id="Win32::IsWinNT()"><a class="permalink" href="Win32.html#Win32::IsWinNT()">#</a><a id="Win3240"></a><a id="Win32::IsWinNT"></a>Win32::IsWinNT()</dt>
<dd>

<p>[CORE] Returns non zero if the Win32 subsystem is Windows NT.</p>

</dd>
<dt id="Win32::IsWin95()"><a class="permalink" href="Win32.html#Win32::IsWin95()">#</a><a id="Win3241"></a><a id="Win32::IsWin95"></a>Win32::IsWin95()</dt>
<dd>

<p>[CORE] Returns non zero if the Win32 subsystem is Windows 95.</p>

</dd>
<dt id="Win32::LoadLibrary(LIBNAME)"><a class="permalink" href="Win32.html#Win32::LoadLibrary(LIBNAME)">#</a><a id="Win3242"></a><a id="Win32::LoadLibrary-LIBNAME"></a>Win32::LoadLibrary(LIBNAME)</dt>
<dd>

<p>Loads a dynamic link library into memory and returns its module handle. This handle can be used with Win32::GetProcAddress() and Win32::FreeLibrary(). This function is deprecated. Use the Win32::API module instead.</p>

</dd>
<dt id="Win32::LoginName()"><a class="permalink" href="Win32.html#Win32::LoginName()">#</a><a id="Win3243"></a><a id="Win32::LoginName"></a>Win32::LoginName()</dt>
<dd>

<p>[CORE] Returns the username of the owner of the current perl process. The return value may be a Unicode string.</p>

</dd>
<dt id="Win32::LookupAccountName(SYSTEM,-ACCOUNT,-DOMAIN,-SID,-SIDTYPE)"><a class="permalink" href="Win32.html#Win32::LookupAccountName(SYSTEM,-ACCOUNT,-DOMAIN,-SID,-SIDTYPE)">#</a><a id="Win3244"></a><a id="Win32::LookupAccountName-SYSTEM-ACCOUNT-DOMAIN-SID-SIDTYPE"></a>Win32::LookupAccountName(SYSTEM, ACCOUNT, DOMAIN, SID, SIDTYPE)</dt>
<dd>

<p>Looks up ACCOUNT on SYSTEM and returns the domain name the SID and the SID type.</p>

</dd>
<dt id="Win32::LookupAccountSID(SYSTEM,-SID,-ACCOUNT,-DOMAIN,-SIDTYPE)"><a class="permalink" href="Win32.html#Win32::LookupAccountSID(SYSTEM,-SID,-ACCOUNT,-DOMAIN,-SIDTYPE)">#</a><a id="Win3245"></a><a id="Win32::LookupAccountSID-SYSTEM-SID-ACCOUNT-DOMAIN-SIDTYPE"></a>Win32::LookupAccountSID(SYSTEM, SID, ACCOUNT, DOMAIN, SIDTYPE)</dt>
<dd>

<p>Looks up SID on SYSTEM and returns the account name, domain name, and the SID type.</p>

</dd>
<dt id="Win32::MsgBox(MESSAGE-[,-FLAGS-[,-TITLE]])"><a class="permalink" href="Win32.html#Win32::MsgBox(MESSAGE-%5B,-FLAGS-%5B,-TITLE%5D%5D)">#</a><a id="Win3246"></a><a id="Win32::MsgBox-MESSAGE-FLAGS-TITLE"></a>Win32::MsgBox(MESSAGE [, FLAGS [, TITLE]])</dt>
<dd>

<p>Create a dialog box containing MESSAGE. FLAGS specifies the required icon and buttons according to the following table:</p>

<pre><code class="plaintext">0 = OK
1 = OK and Cancel
2 = Abort, Retry, and Ignore
3 = Yes, No and Cancel
4 = Yes and No
5 = Retry and Cancel

MB_ICONSTOP          &quot;X&quot; in a red circle
MB_ICONQUESTION      question mark in a bubble
MB_ICONEXCLAMATION   exclamation mark in a yellow triangle
MB_ICONINFORMATION   &quot;i&quot; in a bubble</code></pre>

<p>TITLE specifies an optional window title. The default is &quot;Perl&quot;.</p>

<p>The function returns the menu id of the selected push button:</p>

<pre><code class="plaintext">0  Error

1  OK
2  Cancel
3  Abort
4  Retry
5  Ignore
6  Yes
7  No</code></pre>

</dd>
<dt id="Win32::NodeName()"><a class="permalink" href="Win32.html#Win32::NodeName()">#</a><a id="Win3247"></a><a id="Win32::NodeName"></a>Win32::NodeName()</dt>
<dd>

<p>[CORE] Returns the Microsoft Network node-name of the current machine.</p>

</dd>
<dt id="Win32::OutputDebugString(STRING)"><a class="permalink" href="Win32.html#Win32::OutputDebugString(STRING)">#</a><a id="Win3248"></a><a id="Win32::OutputDebugString-STRING"></a>Win32::OutputDebugString(STRING)</dt>
<dd>

<p>Sends a string to the application or system debugger for display. The function does nothing if there is no active debugger.</p>

<p>Alternatively one can use the <i>Debug Viewer</i> application to watch the OutputDebugString() output:</p>

<p>http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx</p>

</dd>
<dt id="Win32::RegisterServer(LIBRARYNAME)"><a class="permalink" href="Win32.html#Win32::RegisterServer(LIBRARYNAME)">#</a><a id="Win3249"></a><a id="Win32::RegisterServer-LIBRARYNAME"></a>Win32::RegisterServer(LIBRARYNAME)</dt>
<dd>

<p>Loads the DLL LIBRARYNAME and calls the function DllRegisterServer.</p>

</dd>
<dt id="Win32::SetChildShowWindow(SHOWWINDOW)"><a class="permalink" href="Win32.html#Win32::SetChildShowWindow(SHOWWINDOW)">#</a><a id="Win3250"></a><a id="Win32::SetChildShowWindow-SHOWWINDOW"></a>Win32::SetChildShowWindow(SHOWWINDOW)</dt>
<dd>

<p>[CORE] Sets the <i>ShowMode</i> of child processes started by system(). By default system() will create a new console window for child processes if Perl itself is not running from a console. Calling SetChildShowWindow(0) will make these new console windows invisible. Calling SetChildShowWindow() without arguments reverts system() to the default behavior. The return value of SetChildShowWindow() is the previous setting or <code>undef</code>.</p>

<p>The following symbolic constants for SHOWWINDOW are available (but not exported) from the Win32 module: SW_HIDE, SW_SHOWNORMAL, SW_SHOWMINIMIZED, SW_SHOWMAXIMIZED and SW_SHOWNOACTIVATE.</p>

</dd>
<dt id="Win32::SetConsoleCP(ID)"><a class="permalink" href="Win32.html#Win32::SetConsoleCP(ID)">#</a><a id="Win3251"></a><a id="Win32::SetConsoleCP-ID"></a>Win32::SetConsoleCP(ID)</dt>
<dd>

<p>Sets the input code page used by the console associated with the calling process. The return value of SetConsoleCP() is nonzero on success or zero on failure. To get the console&#39;s input code page, see GetConsoleCP().</p>

</dd>
<dt id="Win32::SetConsoleOutputCP(ID)"><a class="permalink" href="Win32.html#Win32::SetConsoleOutputCP(ID)">#</a><a id="Win3252"></a><a id="Win32::SetConsoleOutputCP-ID"></a>Win32::SetConsoleOutputCP(ID)</dt>
<dd>

<p>Sets the output code page used by the console associated with the calling process. The return value of SetConsoleOutputCP() is nonzero on success or zero on failure. To get the console&#39;s output code page, see GetConsoleOutputCP().</p>

</dd>
<dt id="Win32::SetCwd(NEWDIRECTORY)"><a class="permalink" href="Win32.html#Win32::SetCwd(NEWDIRECTORY)">#</a><a id="Win3253"></a><a id="Win32::SetCwd-NEWDIRECTORY"></a>Win32::SetCwd(NEWDIRECTORY)</dt>
<dd>

<p>[CORE] Sets the current active drive and directory. This function does not work with UNC paths, since the functionality required to required for such a feature is not available under Windows 95.</p>

</dd>
<dt id="Win32::SetLastError(ERROR)"><a class="permalink" href="Win32.html#Win32::SetLastError(ERROR)">#</a><a id="Win3254"></a><a id="Win32::SetLastError-ERROR"></a>Win32::SetLastError(ERROR)</dt>
<dd>

<p>[CORE] Sets the value of the last error encountered to ERROR. This is that value that will be returned by the Win32::GetLastError() function.</p>

</dd>
<dt id="Win32::Sleep(TIME)"><a class="permalink" href="Win32.html#Win32::Sleep(TIME)">#</a><a id="Win3255"></a><a id="Win32::Sleep-TIME"></a>Win32::Sleep(TIME)</dt>
<dd>

<p>[CORE] Pauses for TIME milliseconds. The timeslices are made available to other processes and threads.</p>

</dd>
<dt id="Win32::Spawn(COMMAND,-ARGS,-PID)"><a class="permalink" href="Win32.html#Win32::Spawn(COMMAND,-ARGS,-PID)">#</a><a id="Win3256"></a><a id="Win32::Spawn-COMMAND-ARGS-PID"></a>Win32::Spawn(COMMAND, ARGS, PID)</dt>
<dd>

<p>[CORE] Spawns a new process using the supplied COMMAND, passing in arguments in the string ARGS. The pid of the new process is stored in PID. This function is deprecated. Please use the Win32::Process module instead.</p>

</dd>
<dt id="Win32::UnregisterServer(LIBRARYNAME)"><a class="permalink" href="Win32.html#Win32::UnregisterServer(LIBRARYNAME)">#</a><a id="Win3257"></a><a id="Win32::UnregisterServer-LIBRARYNAME"></a>Win32::UnregisterServer(LIBRARYNAME)</dt>
<dd>

<p>Loads the DLL LIBRARYNAME and calls the function DllUnregisterServer.</p>

</dd>
</dl>

<h1 id="CAVEATS"><a class="permalink" href="Win32.html#CAVEATS">#</a>CAVEATS</h1>

<h2 id="Short-Path-Names"><a class="permalink" href="Win32.html#Short-Path-Names">#</a><a id="Short"></a>Short Path Names</h2>

<p>There are many situations in which modern Windows systems will not have the <a href="https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#short-vs-long-names">short path name</a> (also called 8.3 or MS-DOS) alias for long file names available.</p>

<p>Short path support can be configured system-wide via the registry, but the default on modern systems is to configure short path usage per volume. The configuration for a volume can be queried in a number of ways, but these may either be unreliable or require elevated (administrator) privileges.</p>

<p>Typically, the configuration for a volume can be queried using the <code>fsutil</code> utility, e.g. <code>fsutil 8dot3name query d:</code>. On the C level, it can be queried with a <code>FSCTL_QUERY_PERSISTENT_VOLUME_STATE</code> request to the <code>DeviceIOControl</code> API call, as described in <a href="https://www.codeproject.com/Articles/304374/Query-Volume-Setting-for-State-Windows">this article</a>. However, both of these methods require administrator privileges to work.</p>

<p>The Win32 module does not perform any per-volume check and simply fetches short path names in the same manner as the underlying Windows API call it uses: If short path names are disabled, the call will still succeed but the long name will actually be returned.</p>

<p>Note that on volumes where this happens, <code>GetANSIPathName</code> usually cannot be used to return useful filenames for files that contain unicode characters. (In code page 65001, this may still work.) Handling unicode filenames in this legacy manner relies upon <code>GetShortPathName</code> returning 8.3 filenames, but without short name support, it will return the filename with all unicode characters replaced by question mark characters.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
